{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'numpy.ndarray'>\n",
      "1 2 3 4 5 "
     ]
    }
   ],
   "source": [
    "import numpy as np\n",
    "a = np.array([1,2,3,4,5])\n",
    "print(type(a))\n",
    "\n",
    "# b = np.empty((3,3))\n",
    "# print(b)\n",
    "\n",
    "# b = np.arange(100).reshape(4,5,5)\n",
    "# print(b)\n",
    "# print(b.ndim)  # 维度\n",
    "# print(b.dtype)\n",
    "# print(b.shape)\n",
    "# print(b.size)\n",
    "\n",
    "# for e in a:\n",
    "#     print(e, end=\" \")\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[ 3  6  9 12 15]\n",
      "[ 2  4  6  8 10]\n",
      "[  1   8  27  64 125]\n",
      "[ 2  8 18 32 50]\n",
      "110\n",
      "110\n",
      "110\n"
     ]
    }
   ],
   "source": [
    "a = np.array([1,2,3,4,5])\n",
    "b = np.array([2,4,6,8,10])\n",
    "print(a + b)\n",
    "print(a*2)\n",
    "print(a**3)\n",
    "print(a * b) # 对应位置相乘\n",
    "print(a @ b) # 对应位置相乘取和\n",
    "print(np.dot(a,b))\n",
    "print(np.matmul(a,b))\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "pytorch",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.13"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
